#include <cstdio>
#include <algorithm>

using namespace std;

int n;

struct Node
{
    int x, y;
};

bool operator < ( const Node &a, const Node &b )
{
    return ( a.y - a.x - 1 ) / 2 + a.x < ( b.y - b.x - 1 ) / 2 + b.x;
}

Node a[ 100001 ];

int main( )
{
    int i, t;
    while ( scanf("%d", &n) && n )
    {
        for ( i = 0; i < n; i++ )
            scanf("%d%d", &a[ i ].x, &a[ i ].y);
        sort( a, a + n );
        t = 0;
        for ( i = 0; i < n; i++ )
        {
            if ( t < a[ i ].x )
                t = a[ i ].x;
            if ( t > ( a[ i ].y - a[ i ].x - 1 ) / 2 + a[ i ].x )
                break;
            t += ( a[ i ].y - a[ i ].x ) / 2 + 1;
        }
        if ( i < n )
            puts("NO");
        else
            puts("YES");
    }
    return 0;
}